package com.demonzym.tv.app;

import com.demonzym.tv.util.ConstValue;

import net.tsz.afinal.FinalBitmap;
import net.tsz.afinal.FinalDb;
import net.tsz.afinal.FinalHttp;
import android.app.Application;
import android.os.Environment;

public class MyApplication extends Application {

	public FinalBitmap finalBitmap;
	public FinalHttp finalHttp;
	public FinalDb finalDb;
	
	private static MyApplication mInstance;
	public static MyApplication getInstance(){
		if(mInstance == null)
			mInstance = new MyApplication();
		return mInstance;
	}
	
	@Override
	public void onCreate() {
		// TODO Auto-generated method stub
		super.onCreate();

		mInstance = this;
		
		finalBitmap = FinalBitmap.create(this,
						Environment.getExternalStorageDirectory() + ConstValue.IMG_CACHE_PATH);
		finalHttp = new FinalHttp();
		finalHttp.setDebug();
		finalDb = FinalDb.create(this, ConstValue.APP_DB_NAME, true, 1, null);
		
	}
}
